﻿using smp.QueryDb.Structure;

namespace smp.QueryDb.Executing
{
    public interface IExecuteSet
    {
        Execute Is(object value);
    }

    internal class ExecuteSet : IExecuteSet
    {
        private readonly Execute _execute;
        private readonly ProcedureParameter _parameter;

        internal ExecuteSet(Execute execute, ProcedureParameter parameter)
        {
            _execute = execute;
            _parameter = parameter;
        }

        #region Implementation of IExecuteSet

        public Execute Is(object value)
        {
            _execute.AddParameter(_parameter.Name, _parameter.DataType, _parameter.Direction, value);
            return _execute;
        }

        #endregion
    }
}
